﻿<Page x:Class="BeautySalon.Pages.EntriesPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:BeautySalon.Pages"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="EntriesPage"
      IsVisibleChanged="Page_IsVisibleChanged">

    <Grid Background="White">

        <Grid.RowDefinitions>
            <RowDefinition Height="377"/>
            <RowDefinition Height="73"/>
        </Grid.RowDefinitions>

        <!--Список с записями-->
        <DataGrid Name="dGridEntries"
                  AutoGenerateColumns="False"
                  IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Клиент"
                                    Width="Auto"
                                    Binding="{Binding Client.FirstName}"/>
                <DataGridTextColumn Header="Услуга"
                                    Width="Auto"
                                    Binding="{Binding Service.Title}"/>
                <DataGridTextColumn Header="Время оказания услуги"
                                    Width="Auto"
                                    Binding="{Binding StartTime}"/>
                <DataGridTextColumn Header="Комментарий"
                                    Width="Auto"
                                    Binding="{Binding Comment}"/>
                <DataGridTemplateColumn Width="Auto">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Name="EditBtn"
                                    FontSize="20"
                                    Width="120"
                                    Height="40"
                                    Content="Редактировать"
                                    Click="EditBtn_Click"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        
        <!--Кнопка добавления-->
        <Button Name="AddBtn"
                Grid.Row="1"
                FontSize="20"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Width="130"
                Height="40"
                Content="Добавить"
                Margin="20 0 0 0"
                Click="AddBtn_Click"/>
        
        <!--Кнопка удаления-->
        <Button Name="DeleteBtn"
                Grid.Row="1"
                FontSize="20"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Width="130"
                Height="40"
                Content="Удалить"
                Margin="0 0 20 0"
                Click="DeleteBtn_Click"/>

    </Grid>
</Page>
